Control Ow Analysis of Prolog (extended Remix)

نویسنده

  • Thomas Lindgren
چکیده

The paper describes how to translate a Prolog program into a control ow graph (CFG). The program is annotated with control information and a system of simple set constraints is formed and solved. Using this information, a CFG can be constructed straightforwardly, which is described. In order to represent control information compactly, the paper proposes a method to structure the solution of the analysis to share information. Compressing the control information reduces the size of the control information at least by half for 18 out of 26 benchmarks, and for some programs by an order of magnitude or more. Finally, the control ow of a set of benchmarks is measured. Forward control turns out to be relatively simple, with typically 5 or less jump targets per predicate. In several smaller benchmark programs, all or close to all success returns could be converted into direct jumps. Failure control is more complex, though there are typically 10 or less jump targets per predicate for the benchmark set.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Uppsala Theses in Computing Science 26 Compilation Techniques for Prolog Compilation Techniques for Prolog

Current Prolog compilers are largely limited to optimizing a single predicate at a time. We propose two methods to express the global control of Prolog programs. The rst method transforms a Prolog program into a continuation-passing style, where all operations have explicit success and failure continuations. The second method directly constructs a control ow graph from the Prolog program. This ...

متن کامل

Dealing with Explicit Exceptions in Prolog

Existing logic languages provide some simple "extra-logical" constructs for control manipulation , such as the cut of standard Prolog and the exception handling constructs of other versions of Prolog (e.g. SICStus Prolog). Aspects speciically concerning the ow of control in a language can be quite naturally modelled by means of the Denotational Semantics, and in particular the Denotational Sema...

متن کامل

Development of a Prolog Tracer by Stepwise Enhancement

A Prolog tracer is essentially a Prolog interpreter extended to provide features, such as retry, fail, leap, skip, and quasi-skip, to trace the computational ow of a program. This paper describes how a Prolog tracer may be built by stepwise enhancement. Using this method, rst a collection of partial-tracers are developed, each partial-tracer providing only a part of the tracer's functionality. ...

متن کامل

General Purpose Work Flow Languages General Purpose Work Flow Languages *

Work ow management requires language support for work ow speciication and task speciication. Many approaches and systems for work ow managementtherefore ooer at least one new language for work ow speciication; task speciication is usually done in a traditional language. This is motivated in particular by the fact that many components already exist and the task of the work ow tool is the speciic...

متن کامل

Incremental Flow Analysis

interpretation is a technique for ow analysis widely used in the area of logic programming. Until now it has been used only for the global compilation of Prolog programs. But the programming language Prolog enables the programmer to change the program during run time using the built-in predicates assert and retract. To support the generation of eecient code for programs using these dynamic data...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 1995